﻿//using System;
//using System.IO;
//using System.Runtime.InteropServices;
//using System.Runtime.Remoting;
//using SpeechLib;

//namespace SS2TC.Speech
//{
//    public class InputStream
//    {
//        private Stream audioStream;

//        public byte[] Read()
//        {
//            //SpVoice voice = new SpVoice();
//            //voice.Speak("Hello World!");

//            Guid CLSID_SpInprocRecognizer = new Guid("3BEE4890-4FE9-4A37-8C1E-5E7E12791C1F");
//            Type inProcRecognizerType = Type.GetTypeFromCLSID(CLSID_SpInprocRecognizer, true);
//            ISpeechRecognizer recognizer = Activator.CreateInstance(inProcRecognizerType) as SpSharedRecognizer;

//            if (recognizer == null)
//            {
//                throw new NullReferenceException();
//            }

//            //SpFileStream fileStream = new SpFileStream();
//            //fileStream.Open(@"D:\M.Sc\Projects\SS2TC\Files\ira.wma");
//            //recognizer.AudioInputStream = fileStream;

//            ISpeechBaseStream audioInputStream = recognizer.AudioInputStream;

//            if (recognizer.AudioInputStream == null)
//            {
//                throw new NullReferenceException();
//            }

//            object buffer;
//            audioInputStream.Read(out buffer, 100);

//            if (buffer == null)
//            {
//                throw new NullReferenceException("buffer was null");
//            }

//            return (byte[]) buffer;
//        }
//    }
//}
